package meidi;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/10/10
 * @project AutumnOffer
 * @description
 **/
public class solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double[] x = new double[n];
        double[] y = new double[n];
        for(int i=0;i<n;i++){
            x[i] = sc.nextDouble();
        }
        for(int i=0;i<n;i++){
            y[i] = sc.nextDouble();
        }
        double min = Double.MAX_VALUE;
        for(int i=0;i<n-1;i++){
            for(int j=i+1;j<n;j++ ){
                double temp = Math.sqrt(Math.pow(x[j]-x[i],2)+Math.pow(y[j]-y[i],2));
                if(temp < min) min = temp;
            }
        }
        System.out.println(min);
    }
}
